package com.fadadianqi.logistics.admin.ticket.dao.ibatis;

import com.fadadianqi.logistics.admin.ticket.dao.WinnerDAO;
import com.fadadianqi.logistics.admin.ticket.model.Winner;
import com.fadadianqi.commons.GenericDAOSuport;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Component
public class WinnerDAOImpl extends GenericDAOSuport<String, Winner> implements
        WinnerDAO {

    @Override
    protected Class<?> getObjectClass() {
        return Winner.class;
    }

    @Override
    protected String getTableName() {
        return "ticket_winner";
    }

    @Override
    public int countWinnerByBillId(String billId) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("bill_id", billId);
        return super.countAll(map);
    }

}
